<?php
  require_once('./config.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Signature Creator</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    
    <style type="text/css">
      @font-face {
        font-family: author_font;
        src: url(./includes/font.eot);
        src: local("Snap ITC"), url(./includes/font.ttf) format("truetype");
      }
      
      body {
        color: #000000;
        margin: 0px auto;
        font-size: 16px;
      }
      
      .center {
        margin: 0 auto;
      }
      
      #content {
        margin: 0px auto;
        margin-top: 10px;
        width: 1000px;
        text-align: center;
        /*border: black solid 1px;*/
      }
      
      .header {
        font-size: 26px;
        color: #0000FF;
        text-align: center;
      }
      
      .form {
        margin-top: 25px;
      }
      
      .author {
        text-align: right;
        font-size: 13px;
        font-family: author_font, Comic Sans MS;
        padding-bottom: 25px;
      }
    </style>
    
    <![if lt IE 7]>
      <script type="text/javascript" src="./includes/pngfix.js"></script>
    <![endif]>
</head>
<body>

<?php
  $conn = @mysql_connect(DBHOST.':'.DBPORT, DBUSER, DBPASS);
  if(!$conn) die('Brak połączenia z bazą danych.</body></html>');
  if(!@mysql_select_db(DB_CHR)) die ('Nie znaleziono bazy: `'.DB_CHR.'`.</body></html>');
  if(!@mysql_select_db(DATABASE)) die ('Nie znaleziono bazy: `'.DATABASE.'`.</body></html>');
  @mysql_query('SELECT * FROM `'.TAB_SRC.'` LIMIT 1;') or die('Nie znaleziono tabeli: `'.TAB_IMG.'`.</body></html>');
  @mysql_query('SELECT * FROM `'.TAB_DAT.'` LIMIT 1;') or die('Nie znaleziono tabeli: `'.TAB_DAT.'`.</body></html>');
?>

  <div id="content">
    <div class="header">Welcome in WoW signature designer</div>
    
    <div class="form">
      <form method="POST" action="">
        <?php
          if(($_POST['step1'] != null) && (isset($_POST['background'])) && ($_POST['background'] != null) && (isset($_POST['sign_type'])) && (($_POST['sign_type'] == 0) || ($_POST['sign_type'] == 1) || ($_POST['sign_type'] == 2))) {
            $step = 2;
            include_once('./includes/step2.php');
          } elseif($_POST['step2'] != null) {
            $step = 3;
            include_once('./includes/step3.php');
          } elseif($_POST['step3'] != null) {
            $step = 4;
            include_once('./includes/step4.php');
          } else {
            $step = 1;
            include_once('./includes/step1.php');
          }
        ?>
      </form>
    </div>
    <div class="author">
      Made by <font color="blue">Skorek</font> &copy; 2010
    </div>
  </div>
  
<?php
  @mysql_close($conn);
?>

</body>
</html>
